<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Camiones_utilitarios extends CI_Controller {
    public function __construct() {
        parent::__construct();
        $this->load->model(array(
            'generic_model'
        ));
    }
    
    public function index() {
        $title['title'] = 'Camiones y Utilitarios';
        
        $data['camiones'] = $this->generic_model->gets('unidades');
        foreach ($data['camiones'] as $key => $value) {
            $data['camiones'][$key]['adjuntos'] = $this->generic_model->get_adjuntos($value['idunidad']);
        }
        
        $this->load->view('layout/header', $title);
        $this->load->view('camiones_utilitarios/index', $data);
        $this->load->view('layout/footer');
    }
}
?>
